---@class TBS.BuffBase
---@field New fun():TBS.BuffBase
local BuffBase = TBS.CreateClass("BuffBase")

function BuffBase:OnCreate()
    self.buffId = 0
    self.overlay = 1    --叠加层级
    self.casterId = 0   --施法者id
    self.targetId = 0   --挂载对象
    self.skillId = 0    --哪个技能产生
    self.isInDuring = false
    self.curTime = 0
    self.turnDuring = 0     --持续回合
    self.curTurnDuring = 0  --当前剩余回合
end
function BuffBase:Set(buffId,overlay,casterId,targetId,during)
    self.buffId = buffId
    self.overlay = overlay
    self.targetId = targetId
    self.casterId = casterId
    self.turnDuring = during or -1
    self.curTime = 0
end
function BuffBase:SetCasterId(id)
    self.casterId = id
end
function BuffBase:SetSkillId(id)
    self.skillId = id
end
---当buff销毁后(已从buff容器中移除)
function BuffBase:OnDestroy()

end
function BuffBase:Update(dt)
    if self.isDie then
        return
    end
end
---实例化后，生效前调用(还未加入buff容器中)
function BuffBase:OnBuffAwake()

end
---buff生效时
function BuffBase:OnBuffStart()
    if self.turnDuring > 0 then
        self.isInDuring = true
        self.curTurnDuring = self.turnDuring
    end
end
---相同类型时刷新(更新buff层数、等级、持续时间等)
function BuffBase:OnBuffRefresh()

end
---当buff销毁前(还未从buff容器中移除)
function BuffBase:OnBuffRemove()

end

---定时器间隔触发开始
function BuffBase:StartIntervalThink()

end
---定时器间隔触发
function BuffBase:OnIntervalThink()

end
